SPLEX “Special BASIC file utilities”. SIZE: 1250 bytes. • LIST$ returns any program line of any BASIC program in memory, in the form of a string that is identical to the way the program line would be LISTed. This allows a program to examine the contents of another BASIC program, or even itself, without needing to TRANSFORM it into text. • MODIFY takes a string (a valid line of program BASIC) and merges it into the specified program. This allows a BASIC program to modify any other BASIC program, or even itself, without POKE. • Together, LIST$ and MODIFY allow such things as a telephone directory program with all its data in DATA statements that are updated by the program itself. Syntax: LIST$(line number, optional filename) MODIFY filename, new line as a string including the line number If LIST$ is not given a filename, the currently running program is used. The string returned by LIST$ does NOT contain the line number. If you wish to MODIFY the currently running program, use CAT$(0) as the filename. You don't have to specify CAT$(0)[1,10]. *** SPLEX *** (31D40) File Header (31DAF) Poll Handler (31E0D) 52/24 LIST$(#,?$) (31FB9) 52/23 MODIFY filename$, newline$ (325FC) Poll Handler (32638) 53/55 MAXRC fn (32729) Next File Header Note: The MAXRC command is only used by SPREAD, a commercial spreadsheet program by Chris Bunsen, who also wrote SPLEX. Examples of SPLEX commands in use: U$=LIST$(ERRL) -- line that errored in the current program MODIFY CAT$(0),STR$(ERRL)&" "&U$ -- modify current program's error line to contain U$ 0050 IF LEN(LIST$(M+10)) THEN M=M+10 @ GOTO 50 -- exits with M = next non-existent line numbered by tens Bad bug in SPLEX: Type 10 DIM A(MEM/16). Then type A$=LIST$(10). You will immediately see Memory Lost! The problem is the MEM in the DIMension. In general, any lexfile function (including LEX 01, the built-in lex file) used in a DIM statement of any kind (like INTEGER, COMPLEX, etc.) when pulled out by the LIST$ function during an assignment to a string variable, causes Memory Lost. So anything like A$=LIST$(10,F$) when F$'s line 10 is INTEGER M(MAXRC) will always wipe out.